package com.aoxiang.zbox.mapper;

import com.aoxiang.zbox.model.entity.TodoItem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Description:
 *
 * @author: aoxiang
 * @create: 2025-03-08 20:18
 **/
@Mapper
public interface TodoItemMapper extends BaseMapper<TodoItem> {
    @Select("select * from todo_item where is_deleted = 1")
    List<TodoItem> selectDeletedList();

    @Select("select * from todo_item where id = #{id} and is_deleted = 1")
    TodoItem selectDeleted(@Param("id") Long id);

    @Select("delete from todo_item where id = #{id}")
    void physicalDeletion(@Param("id") Long id);

    void physicalDeletionBatch(@Param("ids") List<Long> ids);
}
